package framework
{
	public function copyAttributes(xml:XML, obj:Object, ignore:Array = null):void
	{
		var pName:String;
		var value:Object;
		if (!xml || !obj) return;
		for each(var s:Object in xml.attributes())
		{
			pName = s.name().toString();
			if (ignore && ignore.indexOf(pName) != -1 ) continue;
			value = s.toString();
			if (Utils.propertyExists(pName,obj))
			{
				Utils.setProperty(pName, obj, value);
			} 
		}
	}
}